<div class="assessmentPeace main">
	<bid-tabs
	  query-fn="assessmentPeace.paginationQuery"
	  query-bean="assessmentPeace.queryData"
	  query-param="bidId"
	  query-type="bid"></bid-tabs>
	<div class="query-info shadowbox">
		<div class="container-header">平安考核</div>
		<form class="base-info pa-form-content"
			name="queryForm" novalidate>
			<div class="pa-form-control pa-form-control-inline">
			  <label>考核名称：</label>
			  <input type="text"
			    ng-model="assessmentPeace.queryData.taskName">
			</div>
			<div class="pa-form-control pa-form-control-inline">
			  <label>巡查人：</label>
			  <input type="text"
			    ng-model="assessmentPeace.queryData.createUserName">
			</div>
			<div class="pa-form-control pa-form-control-inline">
			  <label>考核类型：</label>
			  <select name="checkUnit"
			  	ng-model="assessmentPeace.queryData.dataSource">
			  	<option value=""></option>
			  	<option value="0">内业考核</option>
			  	<option value="1">外业考核</option>
			  </select>
			</div>
			<div class="pa-form-control pa-form-control-inline">
				<label>巡查时间：</label>
				<input type="text" ng-datepicker name="startTime"  
					ng-model="assessmentPeace.queryData.checkCompletedTimeFrom">
					到
				<input type="text" ng-datepicker name="endTime"
				  ng-model="assessmentPeace.queryData.checkCompletedTimeTo">
			</div>
		</form>
		<div class="btn-outer-right">			
			<a class="pa-btn"
				ng-click="assessmentPeace.query(queryForm)">
				<i class="fa fa-search"></i>
				<span class="ml5">查询</span>
			</a>
			<a class="pa-btn reset-btn"
				ng-click="assessmentPeace.reset()">
				<i class="fa fa-repeat"></i>
				<span class="ml5">重置</span>
			</a>		
		</div>
	</div>
	<div class="registration-code">
	  <a class="pa-btn"
	  	authorization-btn="api/securityActivities/app/addSpecialCheckTask"    
	    ng-click="assessmentPeace.addAssessment()"
	    >新增内业考核</a>
	</div>
	<div class="pa-table-container shadowbox">
		<form class="base-info">
			<table class="pa-table">
				<thead>
					<tr>
						<th>考核名称</th>
						<th>考核类型</th>
						<th>巡查标段</th>
						<th>考核人</th>
						<th>考核单位</th>
						<th>考核得分</th>
						<th>考核提交时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="item in assessmentPeace.assessmentPeaceList">
						<td>{{item.taskName}}</td>
						<td>{{item.dataSource  == 1 ? '外业考核' :
								item.dataSource  == 0 ? '内业考核' : ''}}</td>
						<td>{{item.bidName}}</td>
						<td>{{item.createUserName}}</td>
						<td>{{item.role == '0' ? '指挥部' : 
									item.role == '1' ? '总监办' :
									item.role == '2' ? '项目部' : ''}}</td>
						<td>{{assessmentPeace.getTotalScore(item)}}</td>
						<td>{{item.checkCompletedTime1}}</td>
						<td>
							<div class="del"
								authorization-btn="api/securityActivities/app/querySpecialCheckById"
								ng-click="$state.go('specialCheckItemList',{id:item.taskId,type:item.dataSource == '0' ? 'inner' : item.dataSource == '1' ? 'outer' : ''})">
								<i class="fa fa-street-view color"></i>
								<span>查看</span>									
							</div>
							<div class="del"
								authorization-btn="api/securityActivities/specialCheck/deleteSpecialCheckById"
								ng-click="assessmentPeace.deleteAssessmentPeace(item.taskId)">
								<i class="fa fa-trash color"></i>
								<span>删除</span>
							</div>									
						</td>
					</tr>
				</tbody>
			</table>
		</form>
		<div class="total-num">
		  共计<span class="total-num-colorful">
		  {{assessmentPeace.paginationData.total}}</span>条
		</div>
		<!-- 分页 -->
    <div class="pagination-outer">
      <uib-pagination
        total-items="assessmentPeace.paginationData.total"
        ng-model="assessmentPeace.paginationData.pageNum"
        items-per-page="assessmentPeace.paginationData.pageSize"
        ng-change="pageChange()"
        class="pagination-sm"
        boundary-link-numbers="true"
        max-size="5"
        next-text="下一页"
        previous-text="上一页"></uib-pagination>
    </div>
	</div>

	<!-- 新增内业考核 -->
	<script type="text/ng-template" id="addAssessment">
		<div class="item-detail-dialog newItem add-assessment">  
		  <div class="item-detail-dialog-header"> 
		    <div class="title-txt">
		      <span>新增内业考核</span> 
		    </div>
		  </div>  
		  <div class="item-detail-dialog-content">
		    <form name="assessment" novalidate>
		      <div class="row-item">
		        <div class="fixed-left-label"><b>*</b>考核名称：</div> 
		        <div class="right-value">
		          <input type="text" name="taskDescription" required
		            ng-model="vm.assessmentList.taskDescription" />
		        </div> 
		        <span class="error-tip"
		          ng-show="(assessment.$submitted || assessment.taskDescription.$dirty) && assessment.taskDescription.$invalid">
		          必填
		        </span>
		      </div>  
		      <div class="row-item"> 
		        <div class="fixed-left-label"><b>*</b>考核项目：</div>
		        <div class="right-value">
		        	<div class="del" ng-click="vm.openTree()">
		        		<img src="../../../assets/images/add-item-icon.png">
		        		<span>新增考核项</span>
		        	</div>		          
		          <!-- ztree nodes -->
		          <div class="tree-container shadowbox"
		            ng-class="{active: vm.treeActive}"
		            ng-show="vm.treeActive">
		            <div class="tree-header">
		              <span>考核项分类</span>
		              <i class="fa fa-times"
		                ng-click="vm.closeTree()"></i>
		            </div>
		            <ul class="ztree" id="tree">
		              
		            </ul>
		          </div>
		        </div> 
		      </div>
		      <div class="row-item"> 
		        <div class="fixed-left-label">内业检查项：</div> 
		        <div class="right-value">
		          <a class="pa-item-btn"
		            ng-repeat="item in vm.innerCheckItemList"
		            ng-class="{active: item.active}">
		            {{item.name}}
		          </a> 
		        </div>  
		      </div>
		      <div class="row-item">  
		        <div class="fixed-left-label"><b>*</b>检查地点：</div>  
		        <div class="right-value"> 
	            <select name="checkUnit" required
	            	ng-model="vm.assessmentList.carryOutBidId">
	            	<option value=""></option>
	            	<option ng-repeat="bid in vm.bidList"
	            		value="{{bid.tenderId}}">{{bid.tenderName}}</option>
	            </select>
		        </div>
		        <span class="error-tip"
		          ng-show="(assessment.$submitted || assessment.checkUnit.$dirty) && assessment.checkUnit.$invalid">
		          必填
		        </span>
		      </div>
		    </form>
		  </div> 
		  <div class="item-detail-dialog-footer"> 
		    <a class="pa-btn" ng-click="vm.save(assessment)">  
		      <i class="fa fa-save"></i>  
		      <span class="ml5">提交</span>  
		    </a> 
		    <a class="pa-btn" ng-click="closeThisDialog()"> 
		      <i class="fa fa-times"></i> 
		      <span class="ml5">取消</span>
		    </a> 
		  </div>  
		</div>
	</script>
</div>